package cn.zl.ymcc.controller;

import cn.zl.ymcc.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/oss")
public class OSSController {
    @Autowired
    private AliYunOss aliYunOss;
    @PostMapping("/upload")
    public Result<String> upload(MultipartFile  file) throws Exception {
        String url = aliYunOss.uploadFile(file);
        return Result.success(url);
    }
}
